package sort.sort;


public class SortTest {
    /**
     * 选择排序测试
     */
    public static void test1() {
        Integer[] array = {23,18,430,2,8,20,2,47,37};
        SelectionSort selectionSort = new SelectionSort();
        selectionSort.sortArray(array);
        selectionSort.print();
    }

    /**
     * 冒泡排序1测试
     */

    public static void test2() {
        Integer[] array = {23,18,430,2,8,20,2,47,37};
        BubbleSort1 bubbleSort1 = new BubbleSort1();
        bubbleSort1.sortArray(array);
        bubbleSort1.print();
    }

    /**
     * 冒泡排序2测试
     */
    public static void test3() {
        // 如果内层循环没有交换位置，说明序列完全有序，则提前结束
        Integer[] array = {23,18,430,3,8,20,2,47,37};
        BubbleSort2 bubbleSort2 = new BubbleSort2();
        bubbleSort2.sortArray(array);
        bubbleSort2.print();
    }

    /**
     * 冒泡排序3测试
     */
    public static void test4() {
        // 如果内层循环没有交换位置，说明序列完全有序，则提前结束
        Integer[] array = {23,18,430,3,8,20,2,47,37};
        BubbleSort3 bubbleSort3 = new BubbleSort3();
        bubbleSort3.sortArray(array);
        bubbleSort3.print();
    }
    /**
     * 大根堆排序
     */
    public static void test5() {
        // 如果内层循环没有交换位置，说明序列完全有序，则提前结束
        Integer[] array = {23,18,430,3,8,20,2,47,37};
        HeapSort heapSort = new HeapSort();
        heapSort.sortArray(array);
        heapSort.print();
    }
}
